Windows API one-day training (73) getversionex Function
Windows development is still very fast, from Win95 to Win98, to Win2000 and XP systems. Each system has different functions. to distinguish different systems in a program, you need to obtain
From: http://flyxxtt.blogbus.com/logs/42705986.html
Windows APIThere are two functions availableObtain the system version information.:GetversionAndGetversionex.
GetversionThis function has plagued a lot of programmers, its original design is
Transmission Door C # Interop Series articles:
C # Interoperability Primer Series (i): Introduction to Interoperability in C #
C # Interoperability Primer series (ii): Invoke the Win32 function using platform invoke
C #
Unit GetWindowsName;
InterfaceUses Registry, Windows, ShellAPI;{--------------------------------------------------------------------------}{1. Obtain the current Windows Version}ConstCOsUnknown =-1;COsWin95 = 0;COsWin98 = 1;COsWin98SE = 2;COsWinME =
To implement this function, you must call a system API.
ExitWindowsEx
The function is to log out of the current user, shut down the system, or restart the system.
It sends a WM_QUERYENDSESSION message to all applications so that they can decide
VC + + Get OS Version (excerpt from MSDN)
#include #include
BOOL displaysystemversion (){Osversioninfoex OSVI;BOOL Bosversioninfoex;
Try calling GetVersionEx using the OSVERSIONINFOEX structure.//If that fails, try using the OSVERSIONINFO structure.
Obtain the detailed description of the current Windows operating system version.
Currently, Windows 2003 is supported.
Cstring getosdesc (void){Cstring sosinfo, stmp;Osversioninfoex osvi;Bool bosversioninfoex;
Sosinfo = "N/";
// Try calling
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.